package cn.jiyun.utils;

import lombok.Data;
import lombok.ToString;

/**
 * @Title: ResultResponse
 * @Author 王鸽
 * @Date 2023/8/22 11:04
 */
@Data
@ToString
public class ResultResponse<T> {
    private String Code;
    private String Massage;
    private T data;

    public static ResultResponse success(Object data){
        ResultResponse resultResponse = new ResultResponse<Object>();
        resultResponse.setCode("1");
        resultResponse.setMassage("SUCCESS");
        resultResponse.setData(data);
        return resultResponse;
    }

    public static ResultResponse error(){
        ResultResponse resultResponse = new ResultResponse<Object>();
        resultResponse.setCode("2");
        resultResponse.setMassage("Error");
        return resultResponse;
    }
 }
